#include "test_list.h"

#ifdef TEST_BASIC

#if defined(__GNUC__) || defined(__MINGW32__) || defined(__MINGW__)
    #pragma GCC diagnostic push
    #pragma GCC diagnostic ignored "-Wconversion-null"
#endif



#define TEST_CASE_NAME os
#define TEST_NUMBER(n) BasicFunctional##_##n

#include <os/basic.h>

using namespace os;


#define TEST_BASIC_000
#define TEST_BASIC_001
#define TEST_BASIC_002
#define TEST_BASIC_003
#define TEST_BASIC_004
#define TEST_BASIC_005
#define TEST_BASIC_006
#define TEST_BASIC_007
#define TEST_BASIC_008
#define TEST_BASIC_009
#define TEST_BASIC_010
#define TEST_BASIC_011
#define TEST_BASIC_012
#define TEST_BASIC_013
#define TEST_BASIC_014
#define TEST_BASIC_015
#define TEST_BASIC_016
#define TEST_BASIC_017
#define TEST_BASIC_018
#define TEST_BASIC_019
#define TEST_BASIC_020
#define TEST_BASIC_021
#define TEST_BASIC_022
#define TEST_BASIC_023
#define TEST_BASIC_024
#define TEST_BASIC_025

#define TEST_BASIC_026
#define TEST_BASIC_027
#define TEST_BASIC_028
#define TEST_BASIC_029
#define TEST_BASIC_030
#define TEST_BASIC_031
#define TEST_BASIC_032

//------------------------------------------------------------------------------------------------------//
namespace{

    typedef ::std::string Str;
    const os::path& p = os::WhereProgramIsRunning();

    const os::path& work       = p/"for_test";
    const os::path& file       = work/"file.txt";   
    const os::path& dir        = work/"directory";   
    const os::path& jlink_dir  = work/"jlink_directory";   
    const os::path& dlink_dir  = work/"dlink_directory";   
    const os::path& slink_file = work/"slink_file.txt";   
    const os::path& hlink_file = work/"hlink_file.txt";   
    const os::path& noexist    = work/"noexist";   

    const os::path& rfile       = "for_test/file.txt";   
    const os::path& rdir        = "for_test/directory";   
    const os::path& rjlink_dir  = "for_test/jlink_directory";   
    const os::path& rdlink_dir  = "for_test/dlink_directory";   
    const os::path& rslink_file = "for_test/slink_file.txt";   
    const os::path& rhlink_file = "for_test/hlink_file.txt";   
    const os::path& rnoexist    = "for_test/noexist";   
}
//------------------------------------------------------------------------------------------------------//

#ifdef TEST_BASIC_000
TEST(TEST_CASE_NAME, TEST_NUMBER(000))
{
    EXPECT_EQ(true,  os::Exists(file));
    EXPECT_EQ(true,  os::Exists(dir));
    EXPECT_EQ(true,  os::Exists(jlink_dir));
    EXPECT_EQ(true,  os::Exists(dlink_dir));
    EXPECT_EQ(true,  os::Exists(slink_file));
    EXPECT_EQ(true,  os::Exists(hlink_file));
    EXPECT_EQ(false, os::Exists(noexist));
}
#endif // TEST_BASIC_000


#ifdef TEST_BASIC_001
TEST(TEST_CASE_NAME, TEST_NUMBER(001))
{
    EXPECT_EQ(false, os::IsDir(file));
    EXPECT_EQ(true,  os::IsDir(dir));
    EXPECT_EQ(true,  os::IsDir(jlink_dir));
    EXPECT_EQ(true,  os::IsDir(dlink_dir));
    EXPECT_EQ(false, os::IsDir(slink_file));
    EXPECT_EQ(false, os::IsDir(hlink_file));
    EXPECT_EQ(false, os::IsDir(noexist));
}
#endif // TEST_BASIC_001

#ifdef TEST_BASIC_002
TEST(TEST_CASE_NAME, TEST_NUMBER(002))
{
    EXPECT_EQ(true,  os::IsFile(file));
    EXPECT_EQ(false, os::IsFile(dir));
    EXPECT_EQ(false, os::IsFile(jlink_dir));
    EXPECT_EQ(false, os::IsFile(dlink_dir));
    EXPECT_EQ(true,  os::IsFile(slink_file));
    EXPECT_EQ(true,  os::IsFile(hlink_file));
    EXPECT_EQ(false, os::IsFile(noexist));
}
#endif // TEST_BASIC_002

#ifdef TEST_BASIC_003
TEST(TEST_CASE_NAME, TEST_NUMBER(003))
{
    EXPECT_EQ(false, os::IsSymlink(file));
    EXPECT_EQ(false, os::IsSymlink(dir));
    EXPECT_EQ(true,  os::IsSymlink(jlink_dir));
    EXPECT_EQ(true,  os::IsSymlink(dlink_dir));
    EXPECT_EQ(true,  os::IsSymlink(slink_file));
    EXPECT_EQ(false, os::IsSymlink(hlink_file));
    EXPECT_EQ(false, os::IsSymlink(noexist));
}
#endif // TEST_BASIC_003

#ifdef TEST_BASIC_004
TEST(TEST_CASE_NAME, TEST_NUMBER(004))
{
    EXPECT_EQ(false, os::IsLink(file));
    EXPECT_EQ(false, os::IsLink(dir));
    EXPECT_EQ(true,  os::IsLink(jlink_dir));
    EXPECT_EQ(true,  os::IsLink(dlink_dir));
    EXPECT_EQ(true,  os::IsLink(slink_file));
    EXPECT_EQ(false, os::IsLink(hlink_file));
    EXPECT_EQ(false, os::IsLink(noexist));
}
#endif // TEST_BASIC_004

#ifdef TEST_BASIC_005
TEST(TEST_CASE_NAME, TEST_NUMBER(005))
{
    EXPECT_EQ(true,  os::IsAbsolute(file));
    EXPECT_EQ(true,  os::IsAbsolute(dir));
    EXPECT_EQ(true,  os::IsAbsolute(jlink_dir));
    EXPECT_EQ(true,  os::IsAbsolute(dlink_dir));
    EXPECT_EQ(true,  os::IsAbsolute(slink_file));
    EXPECT_EQ(true,  os::IsAbsolute(hlink_file));
    EXPECT_EQ(true,  os::IsAbsolute(noexist));

    EXPECT_EQ(false, os::IsAbsolute(rfile));
    EXPECT_EQ(false, os::IsAbsolute(rdir));
    EXPECT_EQ(false, os::IsAbsolute(rjlink_dir));
    EXPECT_EQ(false, os::IsAbsolute(rdlink_dir));
    EXPECT_EQ(false, os::IsAbsolute(rslink_file));
    EXPECT_EQ(false, os::IsAbsolute(rhlink_file));
    EXPECT_EQ(false, os::IsAbsolute(rnoexist));
}
#endif // TEST_BASIC_005

#ifdef TEST_BASIC_006
TEST(TEST_CASE_NAME, TEST_NUMBER(006))
{
    EXPECT_EQ(false, os::IsRelative(file));
    EXPECT_EQ(false, os::IsRelative(dir));
    EXPECT_EQ(false, os::IsRelative(jlink_dir));
    EXPECT_EQ(false, os::IsRelative(dlink_dir));
    EXPECT_EQ(false, os::IsRelative(slink_file));
    EXPECT_EQ(false, os::IsRelative(hlink_file));
    EXPECT_EQ(false, os::IsRelative(noexist));

    EXPECT_EQ(true,  os::IsRelative(rfile));
    EXPECT_EQ(true,  os::IsRelative(rdir));
    EXPECT_EQ(true,  os::IsRelative(rjlink_dir));
    EXPECT_EQ(true,  os::IsRelative(rdlink_dir));
    EXPECT_EQ(true,  os::IsRelative(rslink_file));
    EXPECT_EQ(true,  os::IsRelative(rhlink_file));
    EXPECT_EQ(true,  os::IsRelative(rnoexist));
}
#endif // TEST_BASIC_006

#ifdef TEST_BASIC_007
TEST(TEST_CASE_NAME, TEST_NUMBER(007))
{
    #ifdef _WIN32
    const std::string re = Root(p).string();
    const bool success = 
        re.compare(0, 1, "D")==0 ||
        re.compare(0, 1, "d")==0 ||
        re.compare(0, 1, "C")==0 ||
        re.compare(0, 1, "c")==0 ||
        re.compare(0, 1, "E")==0 ||
        re.compare(0, 1, "e")==0 ||
        re.compare(0, 1, "F")==0 ||
        re.compare(0, 1, "f")==0 ;
    EXPECT_EQ(true, success);
    #endif
}
#endif // TEST_BASIC_007


#ifdef TEST_BASIC_008
TEST(TEST_CASE_NAME, TEST_NUMBER(008))
{
}
#endif // TEST_BASIC_008

#ifdef TEST_BASIC_009
TEST(TEST_CASE_NAME, TEST_NUMBER(009))
{
}
#endif // TEST_BASIC_009

#ifdef TEST_BASIC_010
#endif // TEST_BASIC_010

#ifdef TEST_BASIC_011
#endif // TEST_BASIC_011

#ifdef TEST_BASIC_012
#endif // TEST_BASIC_012

#ifdef TEST_BASIC_013
#endif // TEST_BASIC_013

#ifdef TEST_BASIC_014
#endif // TEST_BASIC_014

#ifdef TEST_BASIC_015
#endif // TEST_BASIC_015

#ifdef TEST_BASIC_016
#endif // TEST_BASIC_016

#ifdef TEST_BASIC_017
#endif // TEST_BASIC_017

#ifdef TEST_BASIC_018
#endif // TEST_BASIC_018

#ifdef TEST_BASIC_019
#endif // TEST_BASIC_019

#ifdef TEST_BASIC_020
#endif // TEST_BASIC_020

#ifdef TEST_BASIC_021
#endif // TEST_BASIC_021

#ifdef TEST_BASIC_022
#endif // TEST_BASIC_022

#ifdef TEST_BASIC_023
#endif // TEST_BASIC_023

#ifdef TEST_BASIC_024
#endif // TEST_BASIC_024

#ifdef TEST_BASIC_025
#endif // TEST_BASIC_025

#ifdef TEST_BASIC_026
#endif // TEST_BASIC_026

#ifdef TEST_BASIC_027
#endif // TEST_BASIC_027

#ifdef TEST_BASIC_028
#endif // TEST_BASIC_029

#ifdef TEST_BASIC_030
#endif // TEST_BASIC_030

#ifdef TEST_BASIC_031
#endif // TEST_BASIC_031

#ifdef TEST_BASIC_032
#endif // TEST_BASIC_032

#if defined(__GNUC__) || defined(__MINGW32__) || defined(__MINGW__)
    #pragma GCC diagnostic pop
#endif


#endif



